//package cn.jiangjiesheng.bootstrap.gateway;
//
//import cn.jiangjiesheng.bootstrap.gateway.auth.AuthFilterProperties;
//import cn.jiangjiesheng.bootstrap.qpaas.ApaasAutoConfiguration;
//import cn.jiangjiesheng.bootstrap.qpaas.ApaasJdbcAutoConfiguration;
//import cn.jiangjiesheng.bootstrap.qpaas.PaasTemplate;
//import cn.jiangjiesheng.bootstrap.qpaas.legacy.PlatformService;
//import cn.jiangjiesheng.bootstrap.qpaas.properties.LegacyPaasProperties;
//import cn.jiangjiesheng.bootstrap.qpaas.properties.PaasProperties;
//import lombok.extern.slf4j.Slf4j;
//import okhttp3.ConnectionPool;
//import okhttp3.OkHttpClient;
//import org.springframework.boot.SpringApplication;
//import org.springframework.boot.autoconfigure.SpringBootApplication;
//import org.springframework.boot.context.properties.EnableConfigurationProperties;
//import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.DependsOn;
//import org.springframework.context.annotation.Primary;
//import org.springframework.test.context.TestPropertySource;
//
//import java.util.concurrent.TimeUnit;
//
///**
// * Created by dev@jiangjiesheng.cn on 2022/9/6  <br/>
// *
// * @author dev@jiangjiesheng.cn
// */
//@Slf4j
//@EnableConfigurationProperties({AuthFilterProperties.class, PaasProperties.class, LegacyPaasProperties.class})
//@SpringBootApplication(exclude = {ApaasJdbcAutoConfiguration.class, ApaasAutoConfiguration.class})
//@EnableDiscoveryClient
//@TestPropertySource({"classpath:application-baofeng.yaml", "classpath:bootstrap.yaml"})
//public class DemoGatewayApplication {
//
//    public static void main(String[] args) {
//        SpringApplication.run(DemoGatewayApplication.class, args);
//    }
//
//    @Bean
//    public OkHttpClient okHttpClient() {
//        return new OkHttpClient.Builder()
//                .connectTimeout(30, TimeUnit.SECONDS)
//                .readTimeout(30, TimeUnit.SECONDS)
//                .writeTimeout(30, TimeUnit.SECONDS)
//                .retryOnConnectionFailure(true)
//                .connectionPool(new ConnectionPool(10, 5L, TimeUnit.MINUTES))
////                .addInterceptor(new OkHttpLogInterceptor())
//                .build();
//    }
//
//    @Bean
//    public PaasTemplate paasTemplate(PaasProperties paasProperties) {
//        return new PaasTemplate(paasProperties);
//    }
//
//    @Primary
//    @Bean(name = "paasConfig")
//    public LegacyPaasProperties paasConfig(LegacyPaasProperties legacyPaasProperties) {
//        return legacyPaasProperties;
//    }
//
//
//    /**
//     * legacy needed
//     *
//     * @return
//     */
//    @DependsOn("paasConfig")
//    @Bean
//    public PlatformService platformService() {
//        return new PlatformService();
//    }
//}
